<?php
	/**
	* 
	*/
	class EnvModel extends Model
	{
		protected $trueTableName = 'tb_environment'; 

		public function getEnvs($condition,$start,$size){
			$return = $this->where($condition)->limit($start,$size)->order('id desc')->select();
			log::write(var_export($this->getLastSql(),true),'getEnvs');
			return $return;
		}


		public function addEnv($data){
			$result=[];
			$result=$this->data($data)->add();
			log::write(var_export($this->getLastSql(),true),'addEnv');
			return $result;
		}

		public function delEnv($condition){
			return $this->where($condition)->delete();
		}

		public function getCounts($condition){
			return $this->where($condition)->count();
		}		
	}